package com.miao.springmt.controller;

import com.miao.springmt.pojo.Customer;
import com.miao.springmt.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("test")
public class TestController {

    @Autowired
    CustomerService customerService;

    @RequestMapping(value = "query",method = RequestMethod.POST)
    @ResponseBody
    public Customer queryCustomerById(String id){
        Customer c= customerService.queryById(id);
        return c;
    }

}
